package com.me.forum.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.me.enums.RespType;
import com.me.forum.domain.Plate;
import com.me.forum.request.PlateRequest;
import com.me.forum.service.IPlateService;
import com.me.forum.utils.components.model.IModel;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@RestController
@RequestMapping("/plate")
public class PlateController {
    @Autowired
    private IPlateService plateService;

    /**
     * @Description:通过分区获取板块
     * @Author: Hao
     * @Date: 2020/4/27 10:29
     */
    @GetMapping("")
    public Object getAll(PlateRequest preq, String page, String size, IModel model){
        IPage<Plate> plates = plateService.getAll(preq,page,size);
	    model.put("success",plates!=null);
	    return model.add(RespType.Plates, plates);
    }
}
